import axios from 'utils/axios.js'

// 用户登录
export function userLogin (params) {
  return axios({
    url: '/user/login',
    method: 'post',
    params
  })
}
// 用户注册接口
export function userRegister (params) {
  // return axios.get('/mock/user/register.json')

  return axios({
    url:'/user/register',
    method:'post',
    params
  })


}

export function getCode (phone) {
  return axios({
    url:'/user/getCode',
    method:'get',
    params:{
      phone:phone,
      templateType:1
    }
  })
}
// 获取用户详细信息接口
export function getUserInfo () {
  return axios.get('/mock/user/userinfo.json')
}
// 获取用户课程信息接口
export function getUserCourse () {
  return axios.get('/mock/user/course.json')
}


/**
 * 获取历史记录
 * @param params
 */
export function getHistory (params) {
  return axios({
    url:'/history/queryAllByPage',
    method:'get',
    params:params
  })
}


/**
 * 获取收藏信息
 * @param params
 */
export function getCollect (params) {
  return axios({
    url:'/collect/queryAllByPage',
    method:'get',
    params:params
  })
}